References
Explanations
-
-
Starts with the basics, like
int main() { return 0; }.
-
-
Bill Sky - The Computer Guy (Playlist) .
-
Haven't seen it yet, but I think I like the guy.
-
Tips
-
Eskil Steenberg - How I program C .
-
Excellent video!
-
Slide 17, 18:
-
Interesting how it organizes the
.hfiles.
-
-
Slide 19:
-
Only uses
uint,intis only used when it can actually be signed. -
Defends macro for generics.
-
Defends
__FILE__and__LINE__.
-
-
Slide 21, 22, 23:
-
Memory and pointer intuition. Very good.
-
-
Slide 24:
-
Very interesting use of
sizeof.
-
-
Slide 25, 26:
-
Arrays explanation.
-
-
Slide 27, 28, 29, 30, 31, 32:
-
Structs.
-
OOP via pointer casting.
-
Padding explanation.
-
-
Slide 33:
-
How the OS gives memory to you.
-
Using
gflags.exeto find bugs where an unexpected variable in the stack is changed when changing the last element of an array.-
Bound checking in a nutshell.
-
-
-
Slide 34, 35:
-
CPU cycles.
-
Against Linked List, due to cache coherence.
-
-
Slide 36:
-
Hiding the contents of a struct by using a void pointer, so the data cannot be changed directly, to avoid some confusion bugs when having to store some data twice (as for caching, for example).
-
-
Slide 37, 38:
-
Allocating once and using the region to store random things, instead of allocating many times.
-
-
-
-
Great video.(2026-02-20)
-
He uses C99; he arguments against C89 giving examples.
-
Compiler Flags.
-
Includes.
-
You can use
clang --save-tempsfor debugging. -
Avoid the problem by using a Single Translation Unity, also knowing as Unity Build.
-
-
Unity Build.
-
Debugger.
-
Recurring segfault problems can only really be debugged with a debugger. It's very hard to debug a segfault with prints, and the segfault error given is usually terrible and not descriptive.
-
-
ASan.
-
Address Sanitizer.
-
Accessing memory out of scope causes a Segfault, but accessing memory within the scope of something else in the code can cause memory corruption.
-
For this reason, ASan is used to check if access is within the array bounds, etc.
-
-
Arrays:
-
He creates his own arrays and strings using structs, so he can implement his own "boundary checks", etc.
-
.
-
.
-
-
Strings:
-
.
-
-
Indexes and Pointers.
-
Store the index of an object instead of a pointer to the object.
-
If the array is resized while storing pointers to it, its previous pointers become invalid.
-
If the array is resized while storing indices to it, there's absolutely no problem.
-
-
-
Arenas.
-
Related to Lifetime.
-
"Arena = One Lifetime".
-
It's where you store all data that has the same lifetime.
-
There are 3 lifetimes:
-
Static: program.
-
Function.
-
Task.
-
-
-
Remaining keywords
-
and, and_eq, asm, bitand, bitor, compl, default, explicit, export, extern, mutable, noexcept, not, not_eq, or, or_eq, register, thread_local, volatile, xor, xor_eq
Syntax Variations
-
-
A compiler from an experimental C++ 'syntax 2' (Cpp2) to today's 'syntax 1' (Cpp1), to prove out some concepts, share some ideas, and prototype features that can also be proposed for evolving today's C++.
main: () = { words: std::vector = ( "Alice", "Bob" ); hello( words[0] ); hello( words[1] ); } hello: (msg: std::string_view) = { std::cout << "Hello, (msg)$!\n"; }-
Demo .
-